<%@page import="java.util.ArrayList"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
 <%@ page import="modelo.Contato"%>
 <%@page import="controle.Controle"%>
  <%@ page import="java.util.ArrayList" %> 
<title>Contatos</title>
</head>
<body>
	<% ArrayList<Contato> contatos = Controle.listarTodos(); 
	     if(contatos.size() == 0){%>
	<form action="ControleServelt" method="post">
		Name :<input type="text" name="nome"><br/> 
		Email :<input type="text" name="email"><br/> 
		Telefone :<input type="text" name="telefone"><br> 		
		<input type="submit" value="Enviar"><br />
	</form>
	<%} else {
		 for(Contato c: contatos){
		 %>
	   
	   	<form action="ControleServelt" method="post">
		Name :<input type="text" value="<%=c.getNome() %>" name="nome2" disabled="disabled"><br/> 
		Email :<input type="text" value="<%=c.getEmail() %>" name="email2" disabled="disabled"><br/> 
		Telefone :<input type="text" value="<%=c.getTelefone() %>" name="telefone2" disabled="disabled"><br/>
		 <input type="submit" value="Confirme Valores"><br />
	</form>
	
	<% }
	    } %>
</body>
</html>